<?php
namespace Mp\Service\Widget;

use Mp\Service\Common\Asset;

class DateBetween extends Input{

	protected $symbol;

	protected $label = 'daterange';

	protected $js = [
		'static/mp/assets/plugins/datepicker/js/moment-with-locales.min.js',
	//	'mp/assets/plugins/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js',
		'static/mp/assets/plugins/bootstrap-daterangepicker/daterangepicker.js',
		
	];

	protected $css = [
		'static/mp/assets/plugins/bootstrap-datepicker/css/bootstrap-datetimepicker.css',
		'static/mp/assets/plugins/bootstrap-daterangepicker/daterangepicker.css',
	];

	protected $script ;

	protected $view = 'Mp::widgets.datebetween';

	protected function _init($params){
		$this->symbol = 'daterange-'.str_random();
		$this->script  = <<<SCRIPT
	$('#{$this->symbol}').daterangepicker();
SCRIPT;
		
		Asset::js($this->js);
		Asset::css($this->css);
		Asset::script($this->script);
		$this->data = [
			'name' => $this->name,
			'value' => $this->value,
			'symbol' => $this->symbol,
		];
	}

	
}